# 使用基于 Debian 的 OpenJDK 镜像
FROM openjdk:11-jdk-slim-bullseye

# 使用阿里云 Debian 镜像源
RUN sed -i 's/http:\/\/deb.debian.org\/debian\//https:\/\/mirrors.aliyun.com\/debian\//g' /etc/apt/sources.list && \
    sed -i 's/http:\/\/security.debian.org\//https:\/\/mirrors.aliyun.com\/debian-security\//g' /etc/apt/sources.list



# 设置工作目录
WORKDIR /app

# 复制 JAR 文件
COPY j-media-server.jar app.jar

COPY natives /usr/local/lib

# 设置 LD_LIBRARY_PATH 环境变量指向 native 目录
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

# 启动命令（让 JavaCPP 自动处理 native）
ENTRYPOINT ["java", \
  "-Xms128m", \
  "-Xmx1024m", \
  "-jar", \
  "app.jar"]